<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta content="text/html" charset="UTF-8"/>
    <style type='text/css'>
        body {
            font-family: 'Lucida Grande', 'Helvetica Neue', sans-serif;
            font-size: 13px;
            #background: #abdc28;
            background: #abcdef;
        }

        h1 {
            font-size: 80px;
            text-align: center;
            color: #fff;
            text-shadow: 0px 1px 1px #ddd,
            0px 2px 1px #d6d6d6,
            0px 3px 1px #ccc,
            0px 4px 1px #c5c5c5,
            0px 5px 1px #c1c1c1,
            0px 6px 1px #bbb,
            0px 7px 1px #777,
            0px 8px 3px rgba(100, 100, 100, 0.4),
            0px 9px 5px rgba(100, 100, 100, 0.1),
            0px 10px 7px rgba(100, 100, 100, 0.15),
            0px 11px 9px rgba(100, 100, 100, 0.2),
            0px 12px 11px rgba(100, 100, 100, 0.25),
            0px 13px 15px rgba(100, 100, 100, 0.3);
        }

        div {
            position: absolute;
            left: 600px;
            top: 300px;
            #background: #ffffff;
        }
    </style>
</head>
<body id="b">
    <div id="d">
        <h1 id="h1">傻帽</h1>
        <h1 id="h2">来点我啊</h1>
    </div>

<script type="text/javascript">
    var div = document.getElementById('d');
    var hh1 = document.getElementById('h1');
    var hh2 = document.getElementById('h2');
    var body = document.getElementById('b');

    var W = window.innerWidth;
    var H = window.innerHeight;

    div.onmouseover = function(e){
        div.style.left = Math.random()*1100+'px';
        div.style.top = Math.random()*300+'px';
        //div.style.left = '10px';

    };
    div.onmousedown = function(e){
        alert("咦，被你点到了？！");
        alert("好吧，元元");
        alert("你赢了");
        hh1.style.visibility = 'hidden';
        hh2.style.visibility = 'hidden';
        div.style.visibility = 'hidden';
        body.style.background = 'url(y.JPG)';
    };
    var s = setInterval(function(){
        body.style.backgroundColor = getColor();
    },1);

    function getRandomColor(){
        var arrHex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
        var strHex = "#";
        var index;
        for (var i = 0; i < 6; i++) {
            index = Math.round(Math.random() * 15);
            strHex += arrHex[index];
        }
        return strHex;
    }

    var INDEX = 0;
    var FLAG = true;
    function getColor(){
        var arrHex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
        var strHex = "#00";
        var index1,index2;

        index1 = INDEX/16;
        index2 = INDEX%16;
        strHex += arrHex[index1];
        strHex += arrHex[index2];

        strHex += "00";
        if(FLAG)
            INDEX++;
        else{
            INDEX--;
        }
        if(INDEX%(16*16) === 0)
            FLAG = !FLAG;
        return strHex;
    }
</script>
</body>
</html>